<?php
use common\library\comFun;
use yii\helpers\Url;
use yii\helpers\ArrayHelper;

?>
<ul class="layui-tab-title">
    <li <?php if(isset($under_review) && $under_review == 1):?>class="layui-this" <?php endif;?>><a href="<?= Url::toRoute(['/member/application-list','under_review'=>1]) ?>">待审核</a></li>
    <li <?php if(isset($under_review) && $under_review == 2):?>class="layui-this" <?php endif;?>><a href="<?= Url::toRoute(['/member/application-list','under_review'=>2]) ?>">已通过</a></li>
    <li <?php if(isset($under_review) && $under_review == -1):?>class="layui-this" <?php endif;?>><a href="<?= Url::toRoute(['/member/application-list','under_review'=>-1]) ?>">已驳回</a></li>

</ul>

<fieldset class="layui-elem-field " style="padding: 10px;">

    <form class="layui-form layui-form-pane">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">昵称</label>
                <div class="layui-input-inline">
                    <input type="text" name="nickname" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">电话号码</label>
                <div class="layui-input-inline">
                    <input type="text" name="mobile" class="layui-input">
                </div>
            </div>


            <div class="layui-inline">
                <button class="layui-btn" lay-submit="" lay-filter="demo1">查询</button>
            </div>
        </div>
    </form>

<table class="layui-table">
    <colgroup>
        <col>
        <col>
        <col>
        <col width="150">
        <col width="200">
        <col width="80">
    </colgroup>
    <thead>
    <tr>
        <th>昵称</th>
        <th>电话号码</th>
        <th>角色</th>
        <th>城市</th>
        <th>注册时间</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <?php
    foreach ($list as $data) {
        ?>
        <tr>
            <td><?= ArrayHelper::getValue($data, 'nickname') ?></td>
            <td><?= ArrayHelper::getValue($data, 'mobile') ?></td>
            <td>
                <?= $roleList[$data['role']] ?>
            </td>
            <td><?= $data['city_id'] ? $cityList[$data['city_id']]['area_name'] : ''; ?></td>
            <td><?= comFun::formatDate($data['register_time']) ?></td>
            <td>
                <a href="<?= Url::toRoute(['member/ApplicationEdit', 'member_id' => $data['member_id']]) ?>"
                   class="layui-btn layui-btn-small">审核</a>
            </td>
        </tr>
        <?php
    }
    ?>

    </tbody>
</table>
<div id="o-page" data-pages="<?= $pageArr['pageTotal'] ?>"></div>
<script>
    layui.use(['form'], function () {
        layui.form();
    });
</script>
</fieldset>